import 'package:flutter/cupertino.dart';

class CMDProvider extends ChangeNotifier {
  //设备信息
  String deviceID = '';
  Map deviceInfo = {};

  //设备的视频是否暂停
  bool playpause = false;

  //返回信息只接收一次
  bool isOnce = false;

  //wifi的名字
  String wifiName = '';
  getWifiName(String name) {
    wifiName = name;
    notifyListeners();
  }

  //设备配置信息
  Map deviceSettingInfo = {};

  String medisType = '';
  List medisList = [];

  getMedisList(List list) {
    print("length-------${list.length}");
    medisList = [];
    medisList = list;
    notifyListeners();
  }

  getDeviceInfo(Map data) {
    deviceSettingInfo = data;
    playpause = data['properties']['pause'];
    notifyListeners();
  }

  setPlayPauseState(bool state) {
    playpause = state;
    notifyListeners();
  }

  clearInfo() {
    deviceID = '';
    deviceInfo = {};
    deviceSettingInfo = {};
    notifyListeners();
  }
}
